﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kooboo.HtmlFunc;
using Kooboo.HtmlFunc.Providers;

namespace Kooboo.CMS.SiteConverter.Parser.NVelocity
{
    public class PositionParser : ParserBase, IParser<IPosition>
    {
        #region IParser<IPosition> Members

        public void Parse(IPosition obj)
        {
            var markup = string.Format("$Html.FrontHtml().Position(\"{0}\")", obj.Name);
            var markupNode = NodeExtension.CreateNode(markup);
            Razor.PositionParser.ReplaceInner(obj, markupNode);

            // result
            Razor.PositionParser.FillResult(obj, this.Context.Result);
        }

        #endregion
    }
}
